<?php 

class ZendRestClientAdapter implements IRestClient
{
    
    private $_componentInstance = null;
    private $_responceInstance = null;
    
    public function __construct()
    {}
    
    public function __call($func, $params)
    {
        $this->_responceInstance = call_user_func_array(array($this->_componentInstance, $func), $params);
        return $this->_responceInstance;
    }

    public function connect($serverAddress)
    {
        $this->_componentInstance = new Zend_Rest_Client($serverAddress);
    }
    
    public function get()
    {
        return $this->_responceInstance->get();
    }
    
    public function post()
    {
        return $this->_responceInstance->post();
    }
    
    public function put()
    {
        return $this->_responceInstance->put();
    }
    
    public function delete()
    {
        return $this->_responceInstance->delete();
    }
}

?>